<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img :src="bannerImg"/>
      <div class="banner-info">
        <div class="banner-title">{{this.sightName}}</div>
        <div class="banner-number">
          <span><span class="iconfont banner-icon">&#xe615;</span></span>
          {{this.gallarymgs.length}}
        </div>
      </div>
    </div>
    <fade-animation>
    <common-gallary
      :imgs="gallarymgs"
      v-if="showGallary"
      @close="handleGallaryClose"></common-gallary>
      </fade-animation>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default {
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    gallarymgs: Array
  },
  components: {
    CommonGallary,
    FadeAnimation
  },
  data () {
    return {
      showGallary: false
      //  		imgs:['http://img1.qunarzz.com/sight/p0/1612/12/12c25b333ba31926a3.water.jpg_r_800x800_5387fe13.jpg','http://img1.qunarzz.com/sight/p0/1612/64/6417d413f4cc6141a3.water.jpg_r_800x800_62884451.jpg']
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>
<style lang="stylus" scoped>
  .banner
    position:relative
    overflow:hidden
    height:0
    padding-bottom:55%
    .banner-img
      width:100%
    .banner-info
      color:#fff
      display:flex
      position :absolute
      left:0
      right:0
      bottom:0
      line-height:.6rem
      .banner-title
        flex:1
        padding:0 .2rem .2rem
      .banner-number
        padding:0 .4rem
        height:.4rem
        line-height:.4rem
        border-radius:.2rem
        background:rgba(0,0,0,.8)
        font-size:.24rem
        .banner-icon
          font-size:.24rem
</style>
